//
//  DetailPicTableViewCell.m
//  GiftItems
//
//  Created by lanou3g on 15/9/23.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "DetailPicTableViewCell.h"

@implementation DetailPicTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(30, 5, kWidth - 30 * 2, 200)];
        _imageV.backgroundColor = [UIColor grayColor];
        _imageV.contentMode = UIViewContentModeScaleAspectFill;
        [self.contentView addSubview:_imageV];
    }
    return self;
}
- (void)setImageWith:(DetailModel *)model AndHeight:(NSInteger)Height{
    _imageV.frame = CGRectMake(30, 5, kWidth - 30 * 2, Height);
    NSRange r = [model.article rangeOfString:@"|"];
    NSString *url = [model.article substringWithRange:NSMakeRange(0, r.location)];
    [_imageV sd_setImageWithURL:[NSURL URLWithString:url]];
    [self.contentView addSubview:_imageV];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
